.class Lrexsee/network/RexseeNetwork$1;
.super Ljava/lang/Thread;
.source "RexseeNetwork.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lrexsee/network/RexseeNetwork;->ping(Ljava/lang/String;ILrexsee/network/RexseeNetwork$PingRunnable;)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$0:Lrexsee/network/RexseeNetwork;

.field private final synthetic val$pingTimeout:I

.field private final synthetic val$pingUrl:Ljava/lang/String;

.field private final synthetic val$runnable:Lrexsee/network/RexseeNetwork$PingRunnable;


# direct methods
.method constructor <init>(Lrexsee/network/RexseeNetwork;Ljava/lang/String;ILrexsee/network/RexseeNetwork$PingRunnable;)V
    .locals 0

    .prologue
    .line 1
    iput-object p1, p0, Lrexsee/network/RexseeNetwork$1;->this$0:Lrexsee/network/RexseeNetwork;

    iput-object p2, p0, Lrexsee/network/RexseeNetwork$1;->val$pingUrl:Ljava/lang/String;

    iput p3, p0, Lrexsee/network/RexseeNetwork$1;->val$pingTimeout:I

    iput-object p4, p0, Lrexsee/network/RexseeNetwork$1;->val$runnable:Lrexsee/network/RexseeNetwork$PingRunnable;

    .line 96
    invoke-direct {p0}, Ljava/lang/Thread;-><init>()V

    return-void
.end method


# virtual methods
.method public run()V
    .locals 12

    .prologue
    .line 99
    iget-object v7, p0, Lrexsee/network/RexseeNetwork$1;->this$0:Lrexsee/network/RexseeNetwork;

    # getter for: Lrexsee/network/RexseeNetwork;->mBrowser:Lrexsee/core/browser/Browser;
    invoke-static {v7}, Lrexsee/network/RexseeNetwork;->access$0(Lrexsee/network/RexseeNetwork;)Lrexsee/core/browser/Browser;

    move-result-object v7

    if-eqz v7, :cond_0

    iget-object v7, p0, Lrexsee/network/RexseeNetwork$1;->this$0:Lrexsee/network/RexseeNetwork;

    # getter for: Lrexsee/network/RexseeNetwork;->mBrowser:Lrexsee/core/browser/Browser;
    invoke-static {v7}, Lrexsee/network/RexseeNetwork;->access$0(Lrexsee/network/RexseeNetwork;)Lrexsee/core/browser/Browser;

    move-result-object v7

    iget-object v7, v7, Lrexsee/core/browser/Browser;->progressDialog:Lrexsee/core/progress/RexseeProgressDialog;

    sget-object v8, Lrexsee/core/lang/RexseeLanguage;->PROGRESS_ONGOING:Ljava/lang/String;

    invoke-virtual {v7, v8}, Lrexsee/core/progress/RexseeProgressDialog;->show(Ljava/lang/String;)V

    .line 101
    :cond_0
    :try_start_0
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v3

    .line 102
    .local v3, "start":J
    new-instance v5, Ljava/net/URL;

    iget-object v7, p0, Lrexsee/network/RexseeNetwork$1;->val$pingUrl:Ljava/lang/String;

    invoke-direct {v5, v7}, Ljava/net/URL;-><init>(Ljava/lang/String;)V

    .line 103
    .local v5, "url":Ljava/net/URL;
    invoke-virtual {v5}, Ljava/net/URL;->openConnection()Ljava/net/URLConnection;

    move-result-object v6

    check-cast v6, Ljava/net/HttpURLConnection;

    .line 104
    .local v6, "urlc":Ljava/net/HttpURLConnection;
    invoke-static {}, Landroid/webkit/CookieManager;->getInstance()Landroid/webkit/CookieManager;

    move-result-object v1

    .line 105
    .local v1, "cookieManager":Landroid/webkit/CookieManager;
    iget-object v7, p0, Lrexsee/network/RexseeNetwork$1;->val$pingUrl:Ljava/lang/String;

    invoke-virtual {v1, v7}, Landroid/webkit/CookieManager;->getCookie(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .line 106
    .local v0, "cookie":Ljava/lang/String;
    if-eqz v0, :cond_1

    .line 107
    const-string v7, "Cookie"

    invoke-virtual {v6, v7, v0}, Ljava/net/HttpURLConnection;->setRequestProperty(Ljava/lang/String;Ljava/lang/String;)V

    .line 110
    :cond_1
    const-string v7, "User-Agent"

    iget-object v8, p0, Lrexsee/network/RexseeNetwork$1;->this$0:Lrexsee/network/RexseeNetwork;

    # getter for: Lrexsee/network/RexseeNetwork;->mBrowser:Lrexsee/core/browser/Browser;
    invoke-static {v8}, Lrexsee/network/RexseeNetwork;->access$0(Lrexsee/network/RexseeNetwork;)Lrexsee/core/browser/Browser;

    move-result-object v8

    invoke-virtual {v8}, Lrexsee/core/browser/Browser;->getSettings()Landroid/webkit/WebSettings;

    move-result-object v8

    invoke-virtual {v8}, Landroid/webkit/WebSettings;->getUserAgentString()Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v6, v7, v8}, Ljava/net/HttpURLConnection;->setRequestProperty(Ljava/lang/String;Ljava/lang/String;)V

    .line 111
    const-string v7, "Connection"

    const-string v8, "close"

    invoke-virtual {v6, v7, v8}, Ljava/net/HttpURLConnection;->setRequestProperty(Ljava/lang/String;Ljava/lang/String;)V

    .line 112
    iget v7, p0, Lrexsee/network/RexseeNetwork$1;->val$pingTimeout:I

    mul-int/lit16 v7, v7, 0x3e8

    invoke-virtual {v6, v7}, Ljava/net/HttpURLConnection;->setConnectTimeout(I)V

    .line 113
    invoke-virtual {v6}, Ljava/net/HttpURLConnection;->connect()V

    .line 114
    iget-object v7, p0, Lrexsee/network/RexseeNetwork$1;->this$0:Lrexsee/network/RexseeNetwork;

    # getter for: Lrexsee/network/RexseeNetwork;->mBrowser:Lrexsee/core/browser/Browser;
    invoke-static {v7}, Lrexsee/network/RexseeNetwork;->access$0(Lrexsee/network/RexseeNetwork;)Lrexsee/core/browser/Browser;

    move-result-object v7

    if-eqz v7, :cond_2

    iget-object v7, p0, Lrexsee/network/RexseeNetwork$1;->this$0:Lrexsee/network/RexseeNetwork;

    # getter for: Lrexsee/network/RexseeNetwork;->mBrowser:Lrexsee/core/browser/Browser;
    invoke-static {v7}, Lrexsee/network/RexseeNetwork;->access$0(Lrexsee/network/RexseeNetwork;)Lrexsee/core/browser/Browser;

    move-result-object v7

    iget-object v7, v7, Lrexsee/core/browser/Browser;->progressDialog:Lrexsee/core/progress/RexseeProgressDialog;

    invoke-virtual {v7}, Lrexsee/core/progress/RexseeProgressDialog;->hide()V

    .line 115
    :cond_2
    iget-object v7, p0, Lrexsee/network/RexseeNetwork$1;->val$runnable:Lrexsee/network/RexseeNetwork$PingRunnable;

    iget-object v8, p0, Lrexsee/network/RexseeNetwork$1;->val$pingUrl:Ljava/lang/String;

    invoke-virtual {v6}, Ljava/net/HttpURLConnection;->getResponseCode()I

    move-result v9

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v10

    sub-long/2addr v10, v3

    invoke-virtual {v7, v8, v9, v10, v11}, Lrexsee/network/RexseeNetwork$PingRunnable;->run(Ljava/lang/String;IJ)V
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    .line 120
    .end local v0    # "cookie":Ljava/lang/String;
    .end local v1    # "cookieManager":Landroid/webkit/CookieManager;
    .end local v3    # "start":J
    .end local v5    # "url":Ljava/net/URL;
    .end local v6    # "urlc":Ljava/net/HttpURLConnection;
    :goto_0
    return-void

    .line 116
    :catch_0
    move-exception v7

    move-object v2, v7

    .line 117
    .local v2, "e":Ljava/io/IOException;
    iget-object v7, p0, Lrexsee/network/RexseeNetwork$1;->this$0:Lrexsee/network/RexseeNetwork;

    # getter for: Lrexsee/network/RexseeNetwork;->mBrowser:Lrexsee/core/browser/Browser;
    invoke-static {v7}, Lrexsee/network/RexseeNetwork;->access$0(Lrexsee/network/RexseeNetwork;)Lrexsee/core/browser/Browser;

    move-result-object v7

    if-eqz v7, :cond_3

    iget-object v7, p0, Lrexsee/network/RexseeNetwork$1;->this$0:Lrexsee/network/RexseeNetwork;

    # getter for: Lrexsee/network/RexseeNetwork;->mBrowser:Lrexsee/core/browser/Browser;
    invoke-static {v7}, Lrexsee/network/RexseeNetwork;->access$0(Lrexsee/network/RexseeNetwork;)Lrexsee/core/browser/Browser;

    move-result-object v7

    iget-object v7, v7, Lrexsee/core/browser/Browser;->progressDialog:Lrexsee/core/progress/RexseeProgressDialog;

    invoke-virtual {v7}, Lrexsee/core/progress/RexseeProgressDialog;->hide()V

    .line 118
    :cond_3
    iget-object v7, p0, Lrexsee/network/RexseeNetwork$1;->val$runnable:Lrexsee/network/RexseeNetwork$PingRunnable;

    iget-object v8, p0, Lrexsee/network/RexseeNetwork$1;->val$pingUrl:Ljava/lang/String;

    const/4 v9, -0x1

    const-wide/16 v10, -0x1

    invoke-virtual {v7, v8, v9, v10, v11}, Lrexsee/network/RexseeNetwork$PingRunnable;->run(Ljava/lang/String;IJ)V

    goto :goto_0
.end method
